namespace Anvil.Core.Commands
{
    /// <summary>
    /// Set a key/value pair to the context.
    /// </summary>
    public class SetKeyValue : BaseLogic
    {
        private string _KeyID = null;

        /// <summary>
        /// The name of the key field.
        /// </summary>
        public string KeyID
        {
            get { return _KeyID; }
            set { _KeyID = value; }
        }

        private string _KeyValue = null;

        /// <summary>
        /// The name of the key field.
        /// </summary>
        public string KeyValue
        {
            get { return _KeyValue; }
            set { _KeyValue = value; }
        }

        public override bool RequestExecute(IRequestContext context)
        {
            context[KeyID] = KeyValue;
            return CONTINUE;
        }
    }
}